<?php /*a:2:{s:71:"/www/wwwroot/cloud_boss/application/admin/view/system/refresh_node.html";i:1573743224;s:64:"/www/wwwroot/cloud_boss/application/admin/view/public/basic.html";i:1573743224;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title><?php echo htmlentities((isset($title) && ($title !== '')?$title:'重庆优合一众')); ?></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/static/plugs/layui/css/layui.css" media="all"/>
    <!--<link rel="stylesheet" href="/static/layuicms/css/index.css" media="all" />-->
    
<link rel="stylesheet" href="/static/css/admin/public.css" media="all"/>

</head>
<body class="<?php echo htmlentities((isset($body) && ($body !== '')?$body:'childrenBody')); ?>">

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>选择需要刷新的节点的模块</legend>
</fieldset>

<form class="layui-form" action="">
    <div class="layui-form-item" pane="">
        <div class="layui-input-block">
            <?php foreach($module_list as $vo): ?>
            <input type="checkbox" name="module" class="layui-input module" value="<?php echo htmlentities((isset($vo['module']) && ($vo['module'] !== '')?$vo['module']:'')); ?>" lay-skin="primary" title="<?php echo htmlentities((isset($vo['module']) && ($vo['module'] !== '')?$vo['module']:'')); if(!empty($vo['title'])): ?>（<?php echo htmlentities((isset($vo['title']) && ($vo['title'] !== '')?$vo['title']:'')); ?>）<?php endif; ?>" <?php if((isset($vo['is_checked']) && ($vo['is_checked'] !== '')?$vo['is_checked']:false) == 'true'): ?>checked<?php endif; ?>>
            <?php endforeach; ?>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="refresh_node">确定刷新节点</button>
        </div>
    </div>
</form>

<script type="text/javascript" src="/static/plugs/jquery/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="/static/plugs/layui/layui.js"></script>
<script type="text/javascript" src="/static/admin.js"></script>
<script type="text/javascript" src="/static/js/admin/api.js"></script>

<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form
        layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery;

        form.on("submit(refresh_node)", function (data) {

            module = [];
            $("input:checkbox[name='module']:checked").each(function () {
                module.push($(this).val());
            });

            var index = top.layer.msg('系统节点刷新中，请稍候', {icon: 16, time: false, shade: 0.8});
            console.log('刷新节点');
            $.post('<?php echo url("$thisModule/system/refresh_node"); ?>', {
                module: module,
            }, function (res) {
                console.log(res);
                if (res.code == 0) {
                    layer.msg(res.msg, {icon: 1});
                } else {
                    layer.msg(res.msg, {icon: 2});
                }
            }).error(function () {
                layer.msg('系统错误，请稍后再试！', {icon: 2});
            });
            return false;
        })
    })
</script>

</body>
</html>